<?php

namespace App\Validate;

class WxuserValidation extends BaseValidation
{
    // 调用案例 check支持自定义规则

    // make(AmountValidation::class)->check($this->request->all(),__FUNCTION__)

    //返回响应值的  ->response()

    //返回boole   ->get()

    //返回报错信息  ->getError()

    //验证规则
    protected $rule =[
        'type_explain'=>'required',
        'openid'=>'required',
        'rawData'=>'required',
        'code'=>'required',
        'id'=>'required',
    ];
    //自定义验证信息
    protected $message = [
        'type_explain.required'=>'访问页面 必须',
        'openid.required'=>'openid 必须',
        'rawData.required'=>'rawData 必须',
        'code.required'=>'小程序code 必须',
        'id.required'=>'id 必须',
    ];
    
    //自定义场景
    protected $scene = [
        'record'=>"type_explain",
        'logininfo'=>"openid,rawData",
        'loginnew'=>"code",
        'admin_edit'=>"id",
    ];
}
